<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Getting Started</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li class="current"><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Getting Started </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Quickly build and run your first app</p>
<h1>Requirements</h1>
<p>If you don't have it already, grab the latest version of the SDK at <a href="https://www.sifteo.com/developers">https://www.sifteo.com/developers</a></p>
<h1>Installation</h1>
<p>The Sifteo SDK is distributed as a zip archive, and can be unpacked anywhere on your machine.</p>
<p>It is recommended to unpack the SDK archive to a path with no spaces in the name - <code>make</code> is used as the default build tool, which does not handle paths with spaces very well.</p>
<div class="image">
<img src="installation.png" alt="installation.png"/>
</div>
<h2>What's Inside?</h2>
<ul>
<li><b>arm-clang</b> is a C/C++ compiler for Sifteo games</li>
<li><b>slinky</b> is an optimizing linker/code generator for the Sifteo platform</li>
<li><b>stir</b> is an asset preparation tool that converts your visual and audio assets into the compact formats used on Sifteo Cubes</li>
<li><b>siftulator</b> is an emulator that allows you to run and test your applications in simulation before running them on hardware</li>
<li><b>doc</b> contains a copy of the SDK documentation</li>
<li><b>include</b> contains the SDK headers</li>
<li><b>examples</b> contains a variety of example projects</li>
<li><b>sifteo-sdk-shell</b> is a shortcut which starts a new shell with the right environment variables for compiling Sifteo applications with this SDK</li>
</ul>
<p>The Sifteo SDK doesn't dictate any build tools or IDE that must be used to develop applications. This guide, as well as the examples included with the SDK, will assume you're building with good old Makefiles, but you may configure your IDE of choice to build Sifteo applications as long as it can use the compiler and linker we provide.</p>
<h1>Build &amp; Run</h1>
<p>Now we'll build and run <b>stars</b>, one of the example applications in the SDK.</p>
<p>First, ensure your SDK is on a path with no spaces in the name, otherwise <code>make</code> will report errors.</p>
<p>Now, open the appropriate shell, depending on your platform:</p>
<ul>
<li>Windows: double click <code>sifteo-sdk-shell.cmd</code></li>
<li>Mac OS X: double click <code>sifteo-sdk-shell.command</code></li>
<li>Linux: run <code>sifteo-sdk-shell.sh</code></li>
</ul>
<p>The shell opens to the <b>sdk/examples</b> folder within the SDK distribution. From here, navigate into the <b>stars</b> demo, and run <code>make</code> to build the project. </p>
<pre class="fragment">cd stars
make
</pre><p>This should create <code>stars.elf</code> in the current folder - this is the binary that contains the stars application.</p>
<dl class="section note"><dt>Note</dt><dd>The name of the .elf file is specified by the line <code>APP = stars</code> in the <code>Makefile</code> in the stars folder.</dd></dl>
<p>Finally, let's run <code>stars.elf</code> in the Siftulator. </p>
<pre class="fragment">siftulator stars.elf
</pre><p>The simulator should start up and run <code>stars</code>, which should look like the following:</p>
<div class="image">
<img src="stars_example_getting_started.png" alt="stars_example_getting_started.png"/>
</div>
<p>Congratulations! You've just run your first Sifteo Cubes application. Try building the other examples in the <b>examples</b> folder, and modifying them to expore the API.</p>
<p>You may also use any of the examples as a template to create an application of your own.</p>
<ul>
<li>Copy the entire folder of your example of choice to a new location.</li>
<li>Rename the folder, and edit the <code>Makefile</code> to reference your project's new name and source files.</li>
<li>run <code>make</code> to confirm that your new project builds, and run it in the <b>Siftulator</b></li>
</ul>
<h1>Other Build Environments</h1>
<dl class="section note"><dt>Note</dt><dd>If you set up your own build system from scratch, be sure to use the same compiler flags that we provide by default in the Makefiles.<ul>
<li>Compile for a minimal environment, and generate LLVM object files: <pre>-emit-llvm -ffreestanding -nostdinc -msoft-float</pre></li>
<li>Disable unavailable C++ features: <pre>-fno-exceptions -fno-threadsafe-statics -fno-rtti -fno-stack-protector</pre></li>
<li>Recommended flags for warnings and debugging:<pre>-g -Wall -Werror -Wno-unused -Wno-gnu -Wno-c++11-extensions</pre> </li>
</ul>
</dd></dl>
</div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
